/**
 *
 */
package com.androidnetframe.httputil;

import com.androidnetframe.BaseParentActivity;
import com.lidroid.xutils.http.RequestParams;

/**
 * @author 何强
 *         2015-8-26
 *         用于告诉用户在请求需要网络的时候，至少需要传递什么样的参数
 */
public abstract class BaseRequestParams {

    /**
     * 这是Get的请求方式
     */
    public static final int GET = 1;
    /**
     * 这是Post的请求方式
     */
    public static final int POST = 2;
    /**
     * 是否需要将得到的数据解析成javaBean
     */
    public boolean isJavaBean = true;
    public BaseParentActivity activity;
    public String entryPageName;
    public int requestMethod;
    public RequestParams requestParams;

    public boolean haveRequestParams = false;
    public Object obj;//请求参数的bean类

    public BaseRequestParams() {
        requestMethod = POST;//默认采用GET方式请求
        requestParams = new RequestParams();
    }

    abstract public void setContext(BaseParentActivity activity);

    abstract public void setEntryPageName(String entryPageName);

    public void setReqeustBean(Object obj, boolean haveRequestParams) {
        this.obj = obj;
        this.haveRequestParams = haveRequestParams;
    }
    /*
	 * RequestParams使用详解
	 * 添加URL参数
	 * 	addQueryStringParameter(java.util.List<org.apache.http.NameValuePair> nameValuePairs)
	 * 	List<NameValuePair> params=new ArrayList<NameValuePair>();
		//建立一个NameValuePair数组，用于存储欲传送的参数
		params.add(new BasicNameValuePair("pwd","2544"));
		
		addQueryStringParameter(org.apache.http.NameValuePair nameValuePair)
		
		addQueryStringParameter(java.lang.String name, java.lang.String value)
	 * */
}
